<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>注册界面</title>
    <link rel="stylesheet" type="text/css" href="static/plugins/jquery-easyui-1.10.19/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="static/plugins/jquery-easyui-1.10.19/themes/icon.css">
    <script type="text/javascript" src="static/plugins/jquery-easyui-1.10.19/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-1.10.19/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui-1.10.19/locale/easyui-lang-zh_CN.js"></script>

    <script>
        $(function (){
            $('#dd').dialog({
                title: '注册用户',
                width: 400,
                height: 300,
                closed: false,
                cache: false,
                // href: 'get_content.php',
                modal: true,
                buttons:[{
                    text:'保存',
                    iconCls:"icon-save",
                    handler:function(){
                        //保存注册信息
                        $.messager.progress();	// display the progress bar
                        $('#ff').form('submit', {
                            url:'login2Servlet?action=register',
                            onSubmit: function(){
                                var isValid = $(this).form('validate');
                                if (!isValid){
                                    $.messager.progress('close');	// hide progress bar while the form is invalid
                                }
                                return isValid;	// return false will stop the form submission
                            },
                            success: function(data){
                                var data = eval('(' + data + ')'); // change the JSON string to javascript object
                                if (data.code == '200'){
                                    $.messager.alert('提示',data.msg + '返回登录','info')
                                    location.href = 'login2.jsp'
                                }
                                else{
                                    $.messager.alert('提示',data.msg ,'warning')
                                }
                                $.messager.progress('close');	// hide progress bar while submit successfully
                            }
                        });
                    }
                },{
                    text:'退出',
                    iconCls:"icon-save",
                    handler:function(){
                        location.href = "login2.jsp"
                    }
                }]
            });
        })
    </script>
</head>
<body style="background-image: url('static/images/register.jpg.jpg')">
<div id="dd">
    <form id="ff" method="post">
        <table cellpadding="5">
            <tr>
                <td>用户名:</td>
                <td><input class="easyui-textbox" type="text" name="username" data-options="required:true"></input></td>
            </tr>
            <tr>
                <td>密码:</td>
                <td><input class="easyui-textbox" type="text" name="password" data-options="required:true"></input></td>
            </tr>
            <tr>
                <td>确认密码:</td>
                <td><input class="easyui-textbox" type="text" name="passwordcopy" data-options="required:true"></input></td>
            </tr>
<%--            <tr>--%>
<%--                <td>电话号码:</td>--%>
<%--                <td><input class="easyui-textbox" name="message" type="text"></input></td>--%>
<%--            </tr>--%>
        </table>
    </form>

</div>
</body>
</html>
